<?php 
	/*$host=$_GET["host"];	 
	$url=$host;
	$time_start = microtime_float();  
	@file_get_contents($url);
	$time_end = microtime_float();
	$time = $time_end - $time_start;
	$time = ceil($time * 1000);
	foreach($http_response_header as $key=>$value)
	{
		 $poststr.=$value;	
	} 
	if(strstr($poststr,"200 OK"))
	{
		echo '{"code":"1","times":"'.$time.'"}';
	} else{
		echo '{"code":"0","times":"'.$time.'"}';	
	}   
	
	 function microtime_float()
	{
			list($usec, $sec) = explode(" ", microtime());
			return ((float)$usec + (float)$sec);
	}*/
?>  

<?php
 function microtime_float()
{
		list($usec, $sec) = explode(" ", microtime());
		return ((float)$usec + (float)$sec);
}
function send_get($url) 
{  
    $context = array ();  
    $data = array ();
	$context ['http'] = array (   
		'timeout' => 10,    
		'method' => 'GET',   
		'header' => 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:40.0) Gecko/20100101 Firefox/40.0'   
	 );     
	$getstr="";
	$time_start =microtime_float();
	@file_get_contents ($url, false, stream_context_create ( $context ) ); 
	$time_end =microtime_float();
	$time = $time_end - $time_start;
	$time = ceil($time * 1000);
	print_r( $http_response_header);
	foreach($http_response_header as $key=>$value){
		 $getstr.=$value;	
		
	} 
	echo $getstr."12354\n";
	/*if(strstr($getstr,"200 OK")){
		echo '{"code":"1","times":"'.$time.'"}';
	}  else if(strstr($getstr,"302")){
		echo '{"code":"1","times":"'.$time.'"}';
			
	} else if(strstr($getstr,"301")){
		echo '{"code":"1","times":"'.$time.'"}';
	}else{
		echo '{"code":"0","times":"'.$time.'"}';
	}*/
}
$host=$_GET["host"];
send_get($host);
 
?>